home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / rwvector.lha / RWVector2.1 / rw / vdefs.h < prev   
C/C++ Source or Header  |  1989-08-18  |  3KB  |  144 lines

  1. #ifndef DEFS_H
  2. #define DEFS_H
  3. #pragma once
  4.  
  5. /*
  6.  *    Common definitions
  7.  *
  8.  *    Copyright (C) 1988, 1989.
  9.  *
  10.  *    Dr. Thomas Keffer
  11.  *    Rogue Wave Associates
  12.  *    P.O. Box 85341
  13.  *    Seattle WA 98145-1341
  14.  *
  15.  *    Permission to use, copy, modify, and distribute this
  16.  *    software and its documentation for any purpose and
  17.  *    without fee is hereby granted, provided that the
  18.  *    above copyright notice appear in all copies and that
  19.  *    both that copyright notice and this permission notice
  20.  *    appear in supporting documentation.
  21.  *    
  22.  *    This software is provided "as is" without any
  23.  *    expressed or implied warranty.
  24.  *
  25.  *
  26.  *    @(#)vdefs.h    2.1    8/18/89
  27.  */
  28.  
  29. #include "compiler.h"
  30.  
  31. // Do not use inlines if debugging; use bounds checking
  32. #ifdef DEBUG
  33. #define Inline static
  34. #define BOUNDS_CHECK 1
  35. #else
  36. #define Inline inline
  37. #endif
  38.  
  39. #ifdef __ATT1__
  40. overload rint;
  41. extern double rint(double);    // AT&T left this out of math.h
  42. #endif
  43.  
  44.  
  45. // GNU overloads these in math.h
  46. #if !defined(__GNUG__) && NEEDS_OVERLOAD
  47. overload abs;
  48. overload acos;
  49. overload acosh;
  50. overload asin;
  51. overload asinh;
  52. overload atan2;
  53. overload atan;
  54. overload atanh;
  55. overload ceil;
  56. overload cos;
  57. overload cosh;
  58. overload exp;
  59. overload floor;
  60. overload gamma;
  61. overload hypot;
  62. overload log10;
  63. overload log;
  64. overload pow;
  65. overload sin;
  66. overload sinh;
  67. overload sqrt;
  68. overload tan;
  69. overload tanh;
  70. #endif
  71.  
  72. #if NEEDS_OVERLOAD
  73. // Special math functions:
  74. overload ABSOLUTE;
  75. overload cumsum;
  76. overload delta;
  77. overload determinant;
  78. overload dot;
  79. overload expandConjugateEven;
  80. overload expandConjugateOdd;
  81. overload expandEven;
  82. overload expandOdd;
  83. overload inverse;
  84. overload max;
  85. overload mean;
  86. overload min;
  87. overload prod;
  88. overload reverse;
  89. overload rint;
  90. overload rootsOfOne;
  91. overload solve;
  92. overload sum;
  93. overload transpose;
  94. overload trunc;
  95. overload variance;
  96. #endif
  97.  
  98. #define nil     0
  99. #define NL    "\n"
  100.  
  101. #ifndef TRUE
  102. #define TRUE    1
  103. #define FALSE    0
  104. #endif
  105.  
  106. #define Double    double
  107. #define Float    float
  108. #define Int    int
  109.  
  110. typedef double    (*mathFunTy)(double);
  111. typedef int    fortran_int;
  112.  
  113. extern Cdecl double fabs(double);
  114.  
  115. inline double    ABSOLUTE(double a)    {return fabs(a);}    //Can use coprocessor
  116. inline double    max(double a, double b) {return a>b? a : b;}
  117. inline double    min(double a, double b) {return a<b? a : b;}
  118.  
  119. inline int    ABSOLUTE(int a)        {return a<0? -a : a;}
  120. inline int    max(int a, int b)    {return a>b? a : b;}
  121. inline int    min(int a, int b)    {return a<b? a : b;}
  122.  
  123. enum Severity {WARNING, DEFAULT, FATAL};
  124. void        RWerror(Severity);
  125. void        RWnote(const char* routine, const char* comment);
  126.  
  127. #ifdef __ATT1__
  128. // Necessary so cfront mungs the function names properly.  Otherwise,
  129. // it is unpredictable which type gets which name.
  130. extern void cumsum();
  131. extern void delta();
  132. extern void determinant();
  133. extern void dot();
  134. extern void inverse();
  135. extern void prod();
  136. extern void reverse();
  137. extern void solve();
  138. extern void sum();
  139. extern void transpose();
  140. extern void variance();
  141. #endif
  142.  
  143. #endif
  144.